
 
 F u n c t i o n :   g e t S c r i p t ( s t r i n g O r P a t h A r r a y ,   o b j e c t C o n f i g ,   d o m E l e m e n t ) 
 
 
 
 D e s c r i p t i o n :   L o a d s   o n e   o r   m o r e   e x t e r n a l   s c r i p t s   i n t o   t h e   c u r r e n t   d o c u m e n t . 
 
 
 
 R e t u r n s :   N u l l . 
 
 
 
 N o t e :   W h e n   a   c a l l b a c k   f u n c t i o n   i s   d e f i n e d ,   i t   w i l l   e x i c u t e   a f t e r   a l l   r e s o u r c e s   c o m p l e t e   l o a d i n g .   W h e n   b o o l D i s a b l e A s y n c   i s   s e t   t o   t r u e ,   s c r i p t s   w i l l   l o a d   i n   t h e   o r d e r   t h e y   h a v e   b e e n   c a l l e d .   T h o u g h   t h e   e l e m e n t C o n t a i n e r   p a r a m e t e r   d e f a u l t s   t o   d o c u m e n t . h e a d ,   i t   c a n   b e   s e t   t o   a n y   D O M - n o d e   c o n t a i n e r   e l e m e n t   w i t h i n   t h e   d o c u m e n t .   W h e n   d e f e r   i s   s e t   t o   t r u e ,   a l l   p r o c e s s i n g   w i l l   w a i t   u n t i l   t h e   p a g e   h a s   f i n i s h e d   l o a d i n g   b e f o r e   l o a d i n g   t h e   s p e c i f i e d   r e s o u r c e s . 
 
 
 
 P a r a m e t e r   1 :   E x t e r n a l   R e s o u r c e s 
 
 
 
 T h e   e x t e r n a l   r e s o u r c e s   p a r a m e t e r   m a y   c o n t a i n   a n   a b s o l u t e   o r   r e l a t i v e   f i l e   p a t h   s t r i n g ,   o r   i t   m a y   c o n t a i n   a n   a r r a y   o f   m u l t i p l e   f i l e   p a t h s . 
 
 
 
 P a r a m e t e r   2 :   C o n f i g u r a t i o n   P r o p e r t i e s 
 
 
 
 { 
 
 
 
     / /   L o a d   a s y n c h r o n o u s l y   w i t h   m u l t i t h r e a d i n g . 
 
     d i s a b l e A s y n c :   f a l s e ,   / /   D e f a u l t 
 
 
 
     / /   D e f e r   s c r i p t   e x e c u t i o n   u n t i l   a f t e r   t h e   p a g e   c o m p l e t e s   l o a d i n g . 
 
     d e f e r :   f a l s e ,   / /   D e f a u l t 
 
 
 
     / /   E x e c u t e   a   c a l l b a c k   a f t e r   a l l   e x t e r n a l   r e s o u r c e s   c o m p l e t e   l o a d i n g . 
 
     c a l l b a c k :   f u n c t i o n ( c o n t a i n e r E l e m e n t ,   r e s o u r c e )   { 
 
         / /   D o   s o m e t h i n g   a f t e r   t h e   e x t e r n a l   r e s o u r c e s   l o a d . 
 
     } 
 
 
 
 } 
 
 
 
 E x a m p l e : 
 
 
 
 / /   F e t c h   a n   e x t e r n a l   s c r i p t   t o   l o a d   i n t o   t h e   p a g e . 
 
 $ A . g e t S c r i p t ( " p a t h / r e s o u r c e . j s " ) ; 
 
 
 
 / /   F e t c h   a n   a r r a y   o f   e x t e r n a l   s c r i p t s   t o   l o a d   i n t o   t h e   p a g e   a s y n c h r o n o u s l y . 
 
 $ A . g e t S c r i p t ( [ 
 
     " p a t h / r e s o u r c e 1 . j s " , 
 
     " p a t h / r e s o u r c e 2 . j s " , 
 
     " p a t h / r e s o u r c e 3 . j s " 
 
 ] ) ; 
 
 
 
 / /   F e t c h   a n   a r r a y   o f   e x t e r n a l   s c r i p t s   t o   l o a d   i n t o   t h e   p a g e   s y n c h r o n o u s l y . 
 
 $ A . g e t S c r i p t ( [ 
 
     " p a t h / r e s o u r c e 1 . j s " , 
 
     " p a t h / r e s o u r c e 2 . j s " , 
 
     " p a t h / r e s o u r c e 3 . j s " 
 
 ] ,   { 
 
     d i s a b l e A s y n c :   t r u e 
 
 } ) ; 
 
 
 
 / /   F e t c h   a n   e x t e r n a l   s c r i p t   t o   l o a d   i n t o   t h e   p a g e   t h e n   e x i c u t e   a   c a l l b a c k . 
 
 $ A . g e t S c r i p t ( " p a t h / r e s o u r c e . j s " ,   { 
 
     c a l l b a c k :   f u n c t i o n ( )   { 
 
         / /   D o   s o m e t h i n g 
 
     } 
 
     } ) ; 
 
 
 
 / /   F e t c h   a n   a r r a y   o f   e x t e r n a l   s c r i p t s   t o   l o a d   i n t o   t h e   p a g e   a s y n c h r o n o u s l y   a n d   e x i c u t e   a   c a l l b a c k . 
 
 $ A . g e t S c r i p t ( [ 
 
     " p a t h / r e s o u r c e 1 . j s " , 
 
     " p a t h / r e s o u r c e 2 . j s " , 
 
     " p a t h / r e s o u r c e 3 . j s " 
 
 ] ,   { 
 
     c a l l b a c k :   f u n c t i o n ( )   { 
 
         / /   D o   s o m e t h i n g . 
 
     } 
 
 } ) ; 
 
 
 
 / /   F e t c h   a n   a r r a y   o f   e x t e r n a l   s c r i p t s   t o   l o a d   i n t o   t h e   p a g e   s y n c h r o n o u s l y   a n d   e x i c u t e   a   c a l l b a c k . 
 
 $ A . g e t S c r i p t ( [ 
 
     " p a t h / r e s o u r c e 1 . j s " , 
 
     " p a t h / r e s o u r c e 2 . j s " , 
 
     " p a t h / r e s o u r c e 3 . j s " 
 
 ] ,   { 
 
     d i s a b l e A s y n c :   t r u e , 
 
     c a l l b a c k :   f u n c t i o n ( )   { 
 
         / /   D o   s o m e t h i n g . 
 
     } 
 
 } ) ; 
 
 